var app = getApp();
Page({
  data: {
    username:'',
    UserInfo:null
  },
  onShow: function () {
    var name = wx.getStorageSync("username")
    console.log(name)
    let self = this
    if (name != null && name != ''){
      app.request({
        url: 'api/wechat/getUserInfo',
        method: "GET",
        success: function (res) {
          if (res != null && res.data != null) {
            self.setData({
              username: res.data.info.userName
            })
          }
        }
      })
    }
    
  },
  gotoLogin(){
    wx.navigateTo({
      url: "/page/start/index"
    })
  },
  onHide: function () {

  },
  onUnload: function () {

  }
})